// #include "./inc/cppjieba/Jieba.hpp"
// #include <iostream>
// #include <string>
// #include <vector>

// using namespace std;

// const char *const DICT_PATH = "./dict/jieba.dict.utf8";
// const char *const HMM_PATH = "./dict/hmm_model.utf8";
// const char *const USER_DICT_PATH = "./dict/user.dict.utf8";
// const char *const IDF_PATH = "./dict/idf.utf8";
// const char *const STOP_WORD_PATH = "./dict/stop_words.utf8";

// int main(int argc, char **argv)
// {
// 	cppjieba::Jieba jieba(DICT_PATH,
// 						  HMM_PATH,
// 						  USER_DICT_PATH,
// 						  IDF_PATH,
// 						  STOP_WORD_PATH);

// 	vector<string> words;
// 	string s;
// 	s = "⼩明硕⼠毕业于中国科学院计算所，后在⽇本京都⼤学深造";
// 	cout << s << endl;
// 	cout << "[demo] CutForSearch" << endl;
// 	jieba.CutForSearch(s, words);
// 	cout << limonp::Join(words.begin(), words.end(), "/") << endl;
// 	return EXIT_SUCCESS;
// }



// search algorithm example
#include <iostream>     // std::cout
#include <algorithm>    // std::search
#include <vector>       // std::vector

bool mypredicate (int i, int j) {
  return (i==j);
}

int main () {
  std::vector<int> haystack;

  // set some values:        haystack: 10 20 30 40 50 60 70 80 90
  for (int i=1; i<10; i++) haystack.push_back(i*10);

  // using default comparison:
  int needle1[] = {40,50,60,70};
  std::vector<int>::iterator it;
  it = std::search (haystack.begin(), haystack.end(), needle1, needle1+4);

  if (it!=haystack.end())
    std::cout << "needle1 found at position " << (it-haystack.begin()) << '\n';
  else
    std::cout << "needle1 not found\n";

  // using predicate comparison:
  int needle2[] = {40};
  it = std::search (haystack.begin(), haystack.end(), needle2, needle2+3, mypredicate);

  if (it!=haystack.end())
    std::cout << "needle2 found at position " << (it-haystack.begin()) << '\n';
  else
    std::cout << "needle2 not found\n";

  return 0;
}